﻿namespace CoreEx.Database.Persistence
{
    /// <summary>
    /// Represents a class that is capable of persisting an object to the underlying datastore. 
    /// </summary>
    /// <typeparam name="T">The type of object to persist.</typeparam>
    public interface IObjectPersister<T>
    {
        /// <summary>
        /// Persists the <paramref name="target"/> instance to the underlying datastore.
        /// </summary>
        /// <param name="target">The object to persist.</param>
        /// <param name="state">The current state of the <paramref name="target"/> instance.</param>
        void Persist(T target, IObjectState state);
    }
}
